package cc.lishixi.book.dao.mapper;

import cc.lishixi.book.entity.Librarian;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;


/**
 * Created by LiShixi on 2016/7/24 0024.
 * http://www.lishixi.cc
 */
 /*  String userid;
    String passwd;
    String name;
    int bookp;
    int readerp;
    int parameterp;*/
public class LibrarianRowMapper implements RowMapper<Librarian> {


    @Override
    public Librarian mapRow(ResultSet r, int i) throws SQLException {
        Librarian l = new Librarian();
        l.setId(r.getInt("id"));
        l.setUserid(r.getString("userid"));
        l.setPasswd(r.getString("passwd"));
        l.setName(r.getString("name"));
        l.setBookp(r.getInt("bookp"));
        l.setReaderp(r.getInt("readerp"));
        l.setParameterp(r.getInt("parameterp"));
        return l;
    }
}
